package com.example.demo.controller;

import com.example.demo.bean.HttpResult;
import com.example.demo.bean.SysMenu;
import com.example.demo.service.SystemMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
//@RestController = @Controller+@ResponseBody
@RequestMapping("/menu")
public class SystemMenuController {
    @Autowired
    SystemMenuService systemMenuService;
    @RequestMapping("/querMenu")
    public HttpResult<List<SysMenu>> querMenu(){
        HttpResult<List<SysMenu>> result= new HttpResult<>();
        List<SysMenu> list = systemMenuService.querMenu();
        result.setData(list);
        return result;
    }
}
